//
//  YFEmotionButton.swift
//  Emoji
//
//  Created by 余仿 on 16/4/20.
//  Copyright © 2016年 yf. All rights reserved.
//

import UIKit

class YFEmotionButton: UIButton {

    var emoji:YFEmoji?{

        didSet{

            if let em = emoji{

                self.setImage(UIImage(named: em.imagePath ?? "xxx"), forState: .Normal)

                self.setTitle(em.emojiStr ?? "", forState: .Normal)

                self.titleLabel?.font = UIFont.systemFontOfSize(30)

                if em.isDelete{

                    self.setImage(UIImage(named: "compose_emotion_delete"), forState: .Normal)
                    self.setImage(UIImage(named: "compose_emotion_delete_highlighted"), forState: .Highlighted)
                }
            }
        }
    }

}
